﻿<!-- #include file="mymin.asp" -->
<%
If Request("submit1") <> "" Then

timediff = Trim(Request.Form("time"))
If timediff <> "" Then
	If Not IsDate(timediff) Then Call Error("<card title='出错'><p>时间无效,格式2011-11-11 11:11:11！")
	If Second(timediff)=0 Then Call Error("<card title='出错'><p>时间无效,格式2011-11-11 11:11:11！")
	timediff=DateDiff("s", time_now, timediff)
End If

'----------------------------------------------------------------
'	生成time.asp文件
'----------------------------------------------------------------
dim HU_Config,HU_File

HU_File= "../../config/time.asp"'生成bbs.asp文件路径

HU_Config="<"&"%"
HU_Config=HU_Config+chr(13)&chr(10)&"timediff="""&timediff&""""
HU_Config=HU_Config+chr(13)&chr(10)&"%"&">"
Call savetofile(HU_Config,HU_File)

If timediff="" Then timediff=0

'避免系统异常退出
conn.execute("update 74hu_admin set lastdate='"&dateadd("s", timediff, Now)&"' where id="&keyid)

Response.Write "<meta http-equiv=""refresh"" content=""1;url=index.asp?sid="&sid&"""><title></title></head><body><div class=""main320"">"
Response.Write "成功设置！正在返回..."
else%>
<title>网站时间配置</title></head><body><div class="main400">
<form method="post" action="time.asp">
当前正确时间:<input name="time" type="text" value=""/><br/>
<input type="submit" value="保存配置"/>
<input type="hidden" name="submit1" value="1"/>
<input type="hidden" name="sid" value="<%=sid%>"/>
</form>
格式2011-11-11 11:11:11<br/>
<%end if%><br/>
<a href="index.asp?sid=<%=sid%>">[网站配置]</a><%call Last2%>